<template>
  <div class="div-one">
    <div class="div-two"></div>
    <div class="div-res">
      <i class="el-icon-info">共条记录</i>
    </div>
    <!-- 表格部分 -->
    <div>
      <el-table :data="tableData" style="width: 100%">
        <el-table-column prop="a" label="操作类型" width="180" align="center">
        </el-table-column>
        <el-table-column prop="b" label="操作人" width="180" align="center">
        </el-table-column>
        <el-table-column prop="c" label="执行结果" width="180" align="center">
        </el-table-column>
        <el-table-column prop="d" label="操作时间" width="180" align="center">
        </el-table-column>

        <el-table-column prop="f" label="描述" align="center">
        </el-table-column>
      </el-table>
      <div class="div-button">
        <el-pagination
          background
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="queryObj.page"
          :page-sizes="[10, 20, 30, 50]"
          :page-size="queryObj.pagesize"
          layout="prev, pager, next, sizes, jumper"
          :total="total"
        >
        </el-pagination>
      </div>
    </div>
  </div>
</template>

<script>
import { list } from '@/api/base/logs.js'
export default {
  data () {
    return {
      tableData: [

      ],
      queryObj: {
        page: 1,
        pagesize: 10

      },
      total: 0
    }
  },

  created () {
    this.dataInfo()
  },

  methods: {
    async dataInfo () {
      const { data } = await list(this.queryObj)
      // console.log(data)
      this.tableData = data.list
      this.total = data.counts
      // this.formBase = data
    },
    handleSizeChange (val) {
      this.queryObj.pagesize = val
      this.queryObj.page = 1
      this.dataInfo()
    },
    // 每页多少条
    handleCurrentChange (val) {
      this.queryObj.page = val
      this.dataInfo()
    }
  }
}
</script>

<style scoped lang="less">
.div-one {
  padding: 20px;
  .div-two {
    padding: 20px;
    background-color: #fff;
  }
  .div-res {
    padding: 20px;
  }
  .div-button {
    background-color: #fff;
    padding: 20px 0;
    padding-left: 900px;
  }
}
</style>
